/**
 * Created by Jay on 2016/6/13.
 */
function little_label_classify(){
    //$("body").on("click",".rep_search_lab",function(){
    //    $.ajax({
    //            url:"labelManageController/vagueSearchLabel",
    //            method: "post",
    //            data: {labelName:$(".rep_search_real_lab").val(),pageSize:10,pageNo:1}
    //        })
    //        .done(function(data){
    //            two_ww(data)
    //        })
    //})

    var x=$.bbq.getState('x');
    /*labelManageController/vagueSearchLabel*/
    mccmsa.ajax({
        url: "labelManageController/getLabelByCategory",
        method: "get",
        data: {labelCategoryId:x,pageSize:10,pageNo:1},
        success: function (data) {
            console.log(data);
            two_ww(data);
        }
    })
    function two_ww(data){
        mccmsa.getHtmlFromLocalTemplate({   //将数据打包到模版丢进容器
            templateId: "getColumnTableData_lab_l",
            container: $("#ColumnTableData_lab_l"),
            data: data,
            callback: function(){
                create_page({
                    url:"labelManageController/getLabelByCategory",
                    method:"get",
                    data:data,
                    temp:"getColumnTableData_lab_l",
                    contain:"#ColumnTableData_lab_l",
                    prePageSize:data.result.pageSize,
                    prepageNo:data.result.pageNo,
                    add_data:{labelCategoryId:x}
                })//生成分页

                /*search*/
                $("body").on("click",".delete_label",function(){
                    delete_tips({
                        url:"labelManageController/delLabel",
                        data:{labelId:$(this).attr("data-id")},
                        method:"get",
                        content:"确认删除？",
                        alert:"成功删除",
                        alert_error:"出错了"
                    })
                })

                var return_data=1*data.result.pageNo;//返回的首位数
                sessionStorage.setItem("pageNo",data.result.pageNo);
                sessionStorage.setItem("pageSize",data.result.pageSize);
                sessionStorage.setItem("return_data",return_data);
            }
        })
    }
}
